package com.hqyj.controller;


import com.hqyj.pojo.Exampaper;
import com.hqyj.pojo.Samplepaper;
import com.hqyj.service.ISamplepaperService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpRequest;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.HashMap;

/**
 * <p>
 * 试卷表 前端控制器
 * </p>
 *
 * @author rock
 * @since 2021-11-18
 */
@RestController
@RequestMapping("/samplepaper")
public class SamplepaperController {

    @Autowired
    ISamplepaperService samplepaperService;

    @GetMapping("/list")
    public HashMap<String, Object> select(Samplepaper samplepaper){
        return samplepaperService.select(samplepaper);
    }

    @PostMapping("/deletePaper")
    public HashMap<String, Object> deletePaper(@RequestBody Integer sampleId){
        return samplepaperService.deletePaper(sampleId);
    }

    @PostMapping("/randGeneratePaper")
    public HashMap<String, Object> randGeneratePaper(@RequestBody Samplepaper samplepaper){
        return samplepaperService.randGeneratePaper(samplepaper);
    }

    @GetMapping("/sampleTest")
    public HashMap<String, Object> sampleTest(Samplepaper samplepaper){


        HashMap<String, Object> stringObjectHashMap = samplepaperService.sampleTest(samplepaper);
        return stringObjectHashMap;
    }

}

